package com.ccb.lms.service;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.facade.FacadeDAO;
import com.ccb.lms.model.Borrow;
import com.ccb.lms.util.BasePage;

public class BorrowService implements IBorrowService {
	private FacadeDAO facadeDAO = null;

	
	public FacadeDAO getFacadeDAO() {
		return facadeDAO;
	}

	public void setFacadeDAO(FacadeDAO facadeDAO) {
		this.facadeDAO = facadeDAO;
	}

	public boolean insertBorrow(Borrow borrow) throws SQLException {
		
		return facadeDAO.getBorrowDAO().insertBorrow(borrow);
	}

	public boolean deleteBorrow(Integer borrowNO) throws SQLException {
		
		return facadeDAO.getBorrowDAO().deleteBorrow(borrowNO);
	}

	public boolean updateBorrow(Borrow borrow) throws SQLException {
		
		return facadeDAO.getBorrowDAO().updateBorrow(borrow);
	}

	public List<Borrow> getAllBorrows() throws SQLException {
		
		return facadeDAO.getBorrowDAO().getAllBorrows();
	}

	public Borrow getBorrowByNO(Integer borrowNO) throws SQLException {
		
		return facadeDAO.getBorrowDAO().getBorrowByNO(borrowNO);
	}

	public int getBorrowCount() throws SQLException {
		
		return facadeDAO.getBorrowDAO().getBorrowCount();
	}

	public BasePage getBasePage(int currentPage, int showRecordNum)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Borrow> getBorrowByPage(BasePage basePage) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

}
